// 1. 过滤出当前的组件路由

export const filterRoutes = (routes:any, userId = 1) => {
  const arr = routes.filter((v:any) => v.component)
  const brr = arr.filter((v:any) => v.meta?.userId?.indexOf(userId) !== -1)
  arr.forEach((item:any) => {
    item.children = item.children && item.children.length && filterRoutes(item.children, userId)
  })
  return brr;
}

// 2. 基于当前的组件路由进行递归多虑
